Horizontally affine functions on step-2 Carnot algebras

In this paper we introduce the notion of horizontally affine, h-affine in short, function and give a complete description of such functions on step-2 Carnot algebras. We show that the vector space of h-affine functions on the free step-2 rank-$n$ Carnot algebra is isomorphic to the exterior algebra of $\mathbb{R}^n$. Using that every Carnot algebra can be written as a quotient of a free Carnot algebra, we shall deduce from the free case a description of h-affine functions on arbitrary step-2 Carnot algebras, together with several characterizations of those step-2 Carnot algebras where h-affine functions are affine in the usual sense of vector spaces. Our interest for h-affine functions stems from their relationship with a class of sets called precisely monotone, recently introduced in the literature, as well as from their relationship with minimal hypersurfaces.

groups.In the free step-2 rank-n case, we shall see that the vector space of horizontally affine functions is isomorphic to the exterior algebra of R n .Using the known fact that every step-2 Carnot algebra can be written as a quotient of a free step-2 Carnot algebra, we shall next deduce from the free case a description of horizontally affine functions on arbitrary step-2 Carnot algebras, together with several characterizations of those step-2 Carnot algebras where h-affine functions are affine in the usual sense of vector spaces.
To introduce the discussion, let us recall some definitions.We refer to Section 2 for more details.Let g = g 1 ⊕ g 2 be a step-2 Carnot algebra, which means that g is a finite dimensional real 1 nilpotent Lie algebra of step 2, g 2 := [g, g] denotes the derived algebra, and g 1 denotes a linear subspace of g that is in direct sum with g 2 .Such a Lie algebra is naturally endowed with the group law given by x • y := x + y + [x, y] for x, y ∈ g that makes it a step-2 Carnot group.Actually every step-2 Carnot group can be realized in this way.We shall therefore view a step-2 Carnot algebra both as a Lie algebra and as a Lie group.We also adopt the notation y t := ty for all t ∈ R and y ∈ g.A function f : g → R is said to be horizontally affine, and for brevity we say that f is h-affine and write f ∈ Aff h (g), if for all x ∈ g and y ∈ g 1 the function t ∈ R → f x • y t is affine.Note that this definition is purely algebraic -it has in particular no connection with the choice of a subRiemannian metric structure on g -and can be equivalently restated in geometrical terms as follows.A function f : g → R is h-affine if and only if its restriction to each integral curve of every left-invariant horizontal vector field is affine when seen as a function from R to R, where a left-invariant vector field is said to be horizontal whenever it belongs to g 1 .
Horizontally affine functions appear naturally in relation with monotone sets, an important class of sets introduced by Cheeger and Kleiner [5], see also [4,14,12,8] and the discussion below.However, h-affine functions are studied systematically for the first time here.See also [1] for a further study of a related notion in more general settings.
Our purposes in the present paper are twofold.We first give a description of h-affine functions on step-2 Carnot algebras, starting with the free case from which the general case will follow.We shall next deduce from this description several characterizations of those step-2 Carnot algebras where h-affine functions are affine.We shall keep the standard terminology saying that a function f : g → R is affine, writing f ∈ Aff(g), to mean that f is affine in the usual sense considering the vector space structure on g.Note indeed that by elementary properties of step-2 Carnot algebras, each affine function f ∈ Aff(g) is h-affine.In other words, in every step-2 Carnot algebra g, the vector space Aff(g) is a linear subspace of Aff h (g), see the discussion in Section 2. This inclusion may however be strict, as we shall see.
More explicitly, h-affine functions can be described with the help of the Carnot dilations δ t : g → g given by δ t (x 1 + x 2 ) := tx 1 + t 2 x 2 for x 1 ∈ g 1 , x 2 ∈ g 2 , and t ∈ R * := R \ {0}.Given a non negative integer i we define the vector space of i-homogeneous h-affine functions as Aff h (g) i := {f ∈ Aff h (g) : f • δ t = t i f for all t ∈ R * }.We shall prove that every f ∈ Aff h (g) can be written in a unique way as a finite sum of i-homogeneous h-affine functions for some i's in {0, . . ., κ} where κ := rank g if g is a free step-2 Carnot algebra and κ := rank g − 1 if g is a nonfree step-2 Carnot algebra.Recall that the rank of g is defined as rank g := dim g 1 .Furthermore, denoting by Λ k R n the space of alternating k-multilinear forms over R n (see Section 6 for our conventions about exterior algebra), we shall also prove that for every i ∈ {0, . . ., κ} the vector space Aff h (g) i is isomorphic to a linear subspace of Λ κ−i R κ .See Theorems 1.1, 1.2, and 1.3 for detailed statements.
Let us first consider the free case.Throughout this paper, given an integer n ≥ 2, we shall use the model for the free step-2 rank-n Carnot algebra f n given by equipped with the Lie bracket where the only non trivial relations are given by The induced group law takes the form For notational convenience, we shall frequently identify f n with Λ 1 R n × Λ 2 R n writing elements in f n as (θ, ω) where Given integers n ≥ 2, i ∈ {0, . . ., n}, and η ∈ Λ n−i R n , we define ϕ η : The description of h-affine functions on f n can then be given in terms of the functions ϕ η 's and reads as follows.
Theorem 1.1.For n ≥ 2 we have Furthermore, given i ∈ {0, . . ., n} and ν ∈ Λ n R n \ {0}, we have Therefore, for i ∈ {0, . . ., n}, the spaces Aff h (f n ) i and Λ n−i R n are isomorphic as vector spaces, and hence, so are Aff h (f n ) and Λ * R n .In particular Aff h (f n ) is a finite dimensional vector space with dimension 2 n .
Let us briefly explain our strategy to prove Theorem 1.1.Let ν ∈ Λ n R n \ {0} be fixed.It is rather easy to verify that if a function f : also not hard to verify and follows from general facts about exterior algebra, see Corollary 6.5.The main difficulties are thus to get the decomposition given in Theorem 1.1 (i), see Theorem 3.2 and Proposition 3.4 (i), as well as the fact that every function f ∈ Aff h (f n ) i can be written as f ν = ϕ ν for some ν ∈ Λ n−i R n , see Proposition 3.5.This will occupy most of Section 3 to which we refer for more details.For the sake of completeness, let us mention the geometric interpretation behind the decomposition in Theorem 1.1 when passing from f n for n ≥ 3 to any Lie subalgebra of f n that is isomorphic to f n−1 .It can be proved that the zero level set of non-zero n-homogeneous h-affine functions on f n , namely, the set {(θ, ω) ∈ f n : one gets that its restriction to any Lie subalgebra isomorphic to f n−1 coincides with the restriction to this subalgebra of the sum of the i-homogeneous terms Let us now turn to the general case of arbitrary step-2 Carnot algebras.Our starting point is the known fact that every step-2 Carnot algebra g can be written as a quotient of free step-2 Carnot algebras.Namely, by the universal property of free step-2 Carnot algebras, for every n ≥ rank g, there is a surjective Carnot morphism π : f n → g, see the discussion in Section 2. It turns out that there is a one-to-one correspondence between h-affine functions on g and h-affine functions on f n that factor through f n / Ker π, see Lemma 2.3 and Corollary 2.4.The description of h-affine functions on g can therefore be deduced from the characterization of those functions ϕ η that factor through f n / Ker π.Namely, we shall verify that for η ∈ Λ i R n the function ϕ η factors through f n / Ker π if and only if η annihilates Ker π, which means that η ∈ Anh i Ker π where In the genuinely nonfree setting, such a characterization implies the following decomposition of Aff h (g).
Theorem 1.2.Let g be a step-2 rank-r Carnot algebra.Assume that g is not isomorphic to f r .Then Aff h (g) = r−1 i=0 Aff h (g) i .
Note that, in contrast with the free case, one has Aff h (g) r = {0} when g is a step-2 rank-r Carnot algebra that is not isomorphic to f r .This follows from the fact that Ker π = {0}, and hence Anh 0 Ker π = {0}, whenever π : f r → g is a surjective Carnot morphism.A description of the summands Aff h (g) i is provided by the following theorem that applies both in the free and nonfree case (note that when g = f r and n = r one recovers Theorem 1.1) and where the space of annihilators of Ker π in Λ * R n is defined by Theorem 1.3.Let g be a step-2 rank-r Carnot algebra, n ≥ r, and π : f n → g be a surjective Carnot morphism.Then the following hold true.
(iii) via this correspondence, Aff h (g) i and Anh n−i Ker π are isomorphic as vector spaces.
Consequently, (iv) Aff h (g) and Anh Ker π are isomorphic as vector spaces.
In particular Aff h (g) is a finite dimensional vector space.
As a consequence of Theorem 1.3 one gets that h-affine functions on step-2 Carnot algebras are polynomials and hence smooth.Let us stress here that there is no regularity assumption in our definition of h-affine functions.Such functions are indeed only assumed to be affine when restricted to horizontal lines, and were not even assumed continuous, nor measurable, beforehand.As a further consequence of their smoothness (one actually only needs local integrability), one can characterize elements in Aff h (g) as those locally integrable functions that are harmonic in the distributional sense with respect to every subLaplacian on g, see Remark 2.8.Let us mention that horizontally affine distributions have been recently studied in [1] in wider settings where they can be proved to be polynomials.Note however that this later notion may be different from a pointwise generalization of our present notion of h-affine functions to more general settings, as explained at the end of Remark 2.8.
Several characterizations of step-2 Carnot algebras g where Aff h (g) = Aff(g) can easily be deduced from Theorem 1.3, see Theorem 1.4 below and Section 5.It turns out that one of these characterizations can be formulated using a class of Lie algebras known in literature as I-null, see [11].We recall that a step-2 Carnot algebra g = g 1 ⊕ g 2 is I-null if every bilinear form b : g 1 × g 2 → R satisfying b(x, [x, y]) = 0 for all x, y ∈ g 1 vanishes identically on g 1 × g 2 , see Definition 2.6 and Proposition 2.7.
Note incidentally that it follows from Theorem 1.1 that Aff h (f n ) = Aff(f n ) if and only if n = 2. Therefore the equivalent conditions given in Theorem 1.4 hold true on g = f n if and only if n = 2. Theorem 1.4 can be efficiently applied in several concrete situations which will be discussed in Section 5.2 and to which we refer for more details.
Before closing this introduction, we briefly go back to the relationship between h-affine functions and precisely monotone sets, as defined in [5] in the Heisenberg setting.More generally, a subset of a Carnot algebra, identified with a Carnot group, is said to be precisely monotone if the restriction of its characteristic function to each integral curve of every left-invariant horizontal vector field is monotone when seen as a function from R to R. Equivalently, a precisely monotone set is a h-convex set with h-convex complement, see for instance [15] for more details about h-convex sets.Precisely monotone sets have been classified in the first Heisenberg algebra f 2 , in higher dimensional Heisenberg algebras, and in the direct product f 2 ×R, see [5,14,12].In the aforementioned step-2 settings, it turns out that the boundary of a non empty precisely monotone strict subset is a hyperplane, while in step-3 Carnot algebras the same statement may be false, see [2,3].As a consequence of our results, we actually get plenty of examples of Carnot algebras already in the step-2 case where there are precisely monotone subsets whose boundary is not a hyperplane.Indeed, it can easily be seen that sublevel sets of h-affine functions are precisely monotone.Therefore if g is a step-2 Carnot algebra that is not I-null and if f ∈ Aff h (g) \ Aff(g) then every sublevel set of f is a precisely monotone set whose boundary is not a hyperplane.We refer to the recent paper [13] for a more detailed introduction about precisely monotone sets as well as for a classification of such sets in the step-2 rank-3 case in terms sublevel sets of h-affine functions, and for further discussions about higher rank and higher step cases.To conclude these observations, let us mention that measurable precisely monotone sets, and therefore sublevel sets of h-affine functions on step-2 Carnot algebras, can be proved to be local minimizers for the intrinsic perimeter, see [18, Proposition 3.9] and [13,Proposition 2.9].
The rest of this paper is organized as follows.Section 2 contains our conventions and notations about step-2 Carnot algebras and h-affine functions.We also provide easy facts that will be useful for later arguments.In Section 3 we focus on the the free case and prove Theorem 1.1.Theorems 1.2 and 1.3 are proved in Section 4. Section 5.1 is devoted to the proof of Theorem 1.4 and Section 5.2 to a discussion of several examples.In the final Section 6 we gather notations and facts in linear and exterior algebra.
Acknowledgements.The authors are grateful to an anonymous reader of a previous version of this paper for valuable comments and remarks that helped them to improve and simplify the exposition.

Step-2 Carnot algebras and horizontally affine functions
We recall that a real2 and finite dimensional Lie algebra g is said to be nilpotent of step 2 if the derived algebra g 2 := [g, g] is non trivial, i.e., g 2 = {0}, and central, i.e., [g, g 2 ] = {0}.Here, given U, V ⊂ g, we denote by [U, V ] the linear subspace of g generated by elements of the form [u, v] with u ∈ U , v ∈ V .If g 1 is a linear subspace of g that is in direct sum with g 2 then [g 1 , g 1 ] = g 2 and the decomposition g = g 1 ⊕ g 2 is therefore a stratification of g.As a matter of fact, every stratification of a nilpotent Lie algebra of step 2 is of this form.
A step-2 Carnot algebra g is a Lie algebra nilpotent of step 2 equipped with a stratification g = g 1 ⊕ g 2 .The rank of g is defined as rank g := dim g 1 .Such a Lie algebra is naturally endowed with the group law given by x • y := x + y + [x, y] for x, y ∈ g that makes it a step-2 Carnot group.It is actually well known that any step-2 Carnot group can be realized in this way.We shall therefore view a step-2 Carnot algebra both as a Lie algebra and group.
Throughout this paper, we shall always denote by g = g 1 ⊕ g 2 a step-2 Carnot algebra.Given t ∈ R, x ∈ g, we set x t := tx.Definition 2.1.Given A ⊂ g we say that f : When A = g, one recovers the notion of real valued affine functions on g seen as a vector space.Indeed, since g is nilpotent of step 2, for x, y ∈ g, t ∈ R, we have x•y t = x+t(y+[x, y]) and x + ty = x • (y − [x, y]) t .Therefore f : g → R is g-affine if and only if for every x, y ∈ g, t ∈ R, the function t ∈ R → f (x + ty) is affine, i.e., f is affine, see Proposition 6.1.In particular, real valued affine functions are A-affine for every A ⊂ g.
In the present paper, we are interested in g 1 -affine functions, which we shall call horizontally affine, h-affine in short, namely: Definition 2.2 (h-affine functions).We say that f : g → R is horizontally affine, h-affine in short, if f is g 1 -affine.In other words, f is h-affine if for every x ∈ g, y ∈ g 1 , the function t ∈ R → f (x • y t ) is affine.We denote by Aff h (g) the real vector space of h-affine functions on g.
We say that ℓ ⊂ g is a horizontal line if there are x ∈ g, y ∈ g 1 \ {0} such that ℓ = {x • y t : t ∈ R}.We already noticed that horizontal lines are 1-dimensional affine subspaces of g and therefore h-affine functions can equivalently be defined as functions whose restriction to every horizontal line is affine.
We recall that a Carnot morphism π : g → g ′ between step-2 Carnot algebras g = g 1 ⊕ g 2 and g Note that a Carnot morphism is both a homomorphism of graded Lie algebras and a group homomorphism.
Proof.Carnot morphisms map affinely horizontal lines to either horizontal lines or singletons therefore f • π ∈ Aff h (g) when f ∈ Aff h (g ′ ).If the Carnot morphism π : g → g ′ is surjective then every horizontal line in g ′ is the affine image through π of a horizontal line in g and therefore For t ∈ R * := R \ {0} the Carnot dilation δ t : g → g is defined as the linear map such that δ t (x) = t k x for x ∈ g k , k = 1, 2. The family (δ t ) t∈R * is a one parameter group of Carnot automorphisms.Recall that, given a non negative integer i, we denote by Aff h (g) i := {f ∈ Aff h (g) : f • δ t = t i f for all t ∈ R * } the linear subspace of Aff h (g) of i-homogeneous h-affine functions on g.Since dilations commute with Carnot morphisms, we get from Lemma 2.3 the following corollary.
Corollary 2.4.Let g, g ′ be step-2 Carnot algebras, π : g → g ′ be a Carnot morphism, and i be a non negative integer.For We already noticed that the set Aff(g) of real valued affine functions on g is a linear subspace of Aff h (g).More precisely, we have the following inclusion.
Proof.Let f ∈ Aff(g).There are f 0 ∈ R and linear forms f k :

Clearly, constant functions belong to
Aff h (g) 0 and the functions x We say that step-2 Carnot algebras are isomorphic if there is a bijective Carnot morphism from one to the other.Note that being h-affine, respectively affine, are intrinsic properties, in particular Aff h (g) = Aff(g) if and only if Aff h (g ′ ) = Aff(g ′ ) for isomorphic step-2 Carnot algebras g, g ′ .This indeed more explicitly follows from Lemma 2.3 together with the fact that Carnot morphisms are linear maps.
Let us recall that by the universal property of free step-2 Carnot algebras, see Section 1 for our conventions about the free step-2 rank-n Carnot algebra f n , given a step-2 rankr Carnot algebra g and given an integer n ≥ r, there is a surjective Carnot morphism π : f n → g, see for instance [17, p.45].We also recall that for such a Carnot morphism, Ker π is a graded ideal in f n , which means that Ker We now recall the definition of I-null Lie algebras that will be used in one of our characterizations of those step-2 Carnot algebras where h-affine functions are affine, see Theorem 1.4.

Definition 2.6 ([11]
).A Lie algebra m is said to be I-null if for every symmetric bilinear invariant form For step-2 Carnot algebras, the previous definition can be rephrased in the following way, of which we omit the elementary proof.
Remark 2.8.In the present article, we focus on step-2 Carnot algebras or, equivalently, step-2 Carnot groups.Let us mention that the notion of horizontally affine function makes sense in broader generality.One may for instance consider Carnot groups of arbitrary step (see [16], [10] for a primer on the subject) or, more generally, a connected nilpotent Lie group G equipped with a vector subspace ∆ of its Lie algebra g that Lie generates g.Then we say that f : G → R is ∆-affine if for every X ∈ ∆ the restriction of f to each integral curve of X is affine when seen as a function from R to R.Here an element X ∈ ∆ is seen as a left-invariant vector field on G.When G is a step-2 Carnot group with stratified Lie algebra g = g 1 ⊕ g 2 and ∆ = g 1 is the first, usually called horizontal, layer of the stratification of g, one recovers Definition 2.2, and this latter definition can hence be extended to Carnot groups of arbitrary step in the obvious way.Going back to the aforementioned more general setting and considering G equipped with a Haar measure, let us mention that we have the following characterizations of locally integrable ∆-affine functions.Namely, f ∈ L 1 loc (G) is ∆-affine if and only if one of the following equivalent conditions holds true in the distributional sense: ) holds true as a consequence of the very definitions.Conversely, if f ∈ L 1 loc (G) satisfies (A.1) then f is smooth by Hörmander's hypoellipticity theorem and it then clearly follows from (A.1) that f is ∆-affine.The fact that (A.1) is equivalent to (A.2) is a consequence of Hörmander's hypoellipticity theorem together with the identity (X + Y ) 3) and X ∈ ∆ \ {0}, one can complete X into a basis X, X 2 , . . ., X m of ∆.Then for every ε > 0 one has with the left-handside converging to X 2 f as ε → 0 and therefore X 2 f = 0. See also [1] for other generalizations of condition (A.1) for locally integrable functions.
To conclude this remark, note that in the specific setting considered in this paper, i.e., step-2 Carnot algebras g = g 1 ⊕ g 2 , it follows from Theorem 1.3 that h-affine functions are smooth and hence locally integrable.Therefore each of the distributional sense conditions (A.1), (A.2), (A.3) with ∆ = g 1 makes sense for all h-affine functions and hence characterizes such a class of functions.In the more general setting considered in the present remark, it is however not clear to us whether ∆-affinity implies local integrability, and the class of locally integrable ∆-affine functions, that can be characterized through each of the equivalent conditions (A.1), (A.2), (A.3), could therefore be a strict subset of the class of ∆-affine functions.

Horizontally affine functions on free step-2 Carnot algebras
This section is devoted to the proof of Theorem 1.1.The proof will proceed into 4 steps.We first verify in Lemma 3.
where ϕ η is given by (1.1), together with the injectivity of the linear map We shall next prove Theorem 1.1 for n = 2, see Theorem 3.2, and deduce properties of h-affine functions on f n for n ≥ 3 to be used in the next step, see Proposition 3.3.When n ≥ 3, we first prove that Aff h (f n ) = n i=0 Aff h (f n ) i together with preliminary information about elements in Aff h (f n ) i , see Proposition 3.4.We then upgrade these information in Proposition 3.5 to get the description stated in Theorem 1.1.
Note that Theorem 1.1 for n = 2 follows from Lemma 2.5, Lemma 3.1 and Theorem 3.2.
We refer to Definition 2.1 for the definition of Σ n -affine functions.
Proof.Clearly, composing h-affine functions with left-translations yields h-affine functions.Therefore, to prove that every f ∈ Aff h (f n ) is Σ n -affine, we only need to verify that for every ) and denote by f h the restriction of f to h.On the one hand, the structure of step-2 Carnot algebra of f n induces on h a structure of step-2 Carnot algebra that makes it isomorphic to f 2 .Therefore Aff h (h) = Aff(h) by Theorem 3.2.On the other hand, f h ∈ Aff h (h).Thus f h ∈ Aff(h), which implies that for all (θ, ω) ∈ h, the function t ∈ R → f (tθ, tω) is affine, and concludes the proof of (3.1).To prove (3.2), note that for for every Σ n -affine function f , and hence, in particular for f ∈ Aff h (f n ) by (3.1).
In addition to the notations given in the appendix, see Section 6, we shall use the following ones in the rest of this section.Recall that (e 1 , . . ., e n ) denotes a basis of Λ We set and we equip I with the lexicographic order, i.e., we write αβ < α ′ β ′ to mean either that α = α ′ and β < β ′ or that α < α ′ .We set We set I n 0 := {∅} and for k ∈ {1, . . ., n(n − 1)/2}.Note that for constants a I ∈ R, (iii) for k ∈ {0, . . ., ⌊(n − 1)/2⌋}, every f ∈ Aff h (f n ) 2k+1 can be written as Let θ ∈ Λ 1 R n be given.We know from (3.1) that, for every it follows from elementary properties of multiaffine maps, see Proposition 6.2 applied to ω ∈ Λ 2 R n → f (θ, ω), that there are c I (θ) ∈ R, I ∈ I n , such that (3.3) holds true.
All together we have shown that f = n i=0 f i with f i ∈ Aff h (f n ) i that can be written as in (ii) when i = 2k is even, respectively, as in (iii) when i = 2k + 1 is odd, which concludes the proof of the proposition.
On the one hand, since f ∈ Aff h (f 2p ), we know that for all (θ, ω) is affine.On the other hand, this function is a polynomial for which the coefficient of t 2 is given by and must therefore vanish.Since this holds true for all ω ∈ Λ 2 R 2p , it follows that for all Now let L ∈ I 2p p−2 be given and let 1 ≤ α < β < δ < γ ≤ 2p be such that {1, . . ., 2p}\N(L) = {α, β, δ, γ}.Then the previous equality reads as we get that a L∪(αβ,δγ) = a L∪(αγ,βδ) .Looking at the coefficient of θ α θ ′ δ θ β θ ′ γ we get that a L∪(αδ,βγ) = −a L∪(αγ,βδ) .Therefore we have proved that σ(I)a I = σ(I ′ )a I ′ for all I, I ′ ∈ I 2p p such that I, I ′ ⊃ L for some L ∈ I 2p p−2 .Since one can pass from any I ∈ I 2p p to any I ′ ∈ I 2p p by a finite number of such steps, (3.7) follows.
We now consider the case where k , be linear forms given by Proposition 3.4 (iii) so that For k = 0 we get that f (θ, ω) = b ∅ (θ) and the required conclusion clearly holds true.Thus assume that k ∈ {1, . . ., ⌊(n − 1)/2⌋} and let θ ∈ Λ 1 R n be given.As in the proof of (3.6), consider the function g : f n → R given by g(τ, ω) := f 2k+1 (θ, ω) for (τ, ω) ∈ f n .We have g ∈ Aff h (f n ), see the proof of (3.6), and since g • δ t = t 2k g, it follows that g ∈ Aff h (f n ) 2k .Then we know from the previous cases and Corollary 6.5 that there is a unique We now claim that θ ∧ η(θ) = 0 for all θ ∈ Λ 1 R n .Indeed, on the one hand, we know that the function On the other hand, we have and hence the coefficient of t 2 vanishes, i.e., 2), we get that θ ∧ η(θ) = 0 for all θ ∈ Λ 1 R n , as claimed.Then the required conclusion follows from Proposition 6.6, and this concludes the proof of the proposition.

Horizontally affine functions on arbitrary step-2 Carnot algebras
In this section we prove Theorem 1.2, that will be deduced from Theorem 1.1 writing a step-2 rank-r Carnot algebra that is not isomorphic to f r as a proper quotient of f r , and Theorem 1.3.The main argument for proving both theorems is given in Lemma 4.1 where we characterize those functions in Aff h (f n ) j that factor through f n /i where i a graded ideal of f n .We refer to (6.4) and (6.5) for the notions of annihilators.For notational convenience, we shall again identify f n with Λ 1 R n × Λ 2 R n throughout this section.Lemma 4.1.Let n ≥ 2 and i be a graded ideal of f n .For j ∈ {0, . . ., n}, η ∈ Λ n−j R n , the map ϕ η given by (1.1) factors through f n /i if and only if η ∈ Anh n−j i. (6.6), this proves the lemma for j = 0.If η ∈ Λ n−1 R n then ϕ η (θ, ω) = θ ∧ η.Therefore ϕ η factors through f n /i if and only if τ ∧ η = 0 for all τ ∈ i 1 , i.e., η ∈ Anh n−1 i 1 = Anh n−1 i, where the last equality comes from (6.7), which proves the lemma for j = 1.Now let j ∈ {2, . . ., n}.For η ∈ Anh n−j i, it easily follows from (1.1) that ϕ η factors through f n /i.Conversely, let η ∈ Λ n−j R n and assume that ϕ η factors through f n /i.Then, for all (θ, ω)

Proof. Write the graded ideal
Identifying the coefficient of degree 1 in t, we get that for all It then follows from (6.1) when j is even, (6.2) when j is odd, and Lemma 6.
where the last equality comes from (6.8), and this concludes the proof of the lemma.
We first prove Theorem 1.2.
Proof of Theorem 1.2.Let g be a step-2 rank-r Carnot algebra that is not isomorphic to f r .Clearly, To prove the converse inclusion, let π : f r → g be a surjective Carnot morphism and ν ∈ Λ r R r \ {0} be fixed.Recall for further use that Ker π is a non trivial graded ideal of f r .Let f ∈ Aff h (g).Then f • π ∈ Aff h (f n ) by Lemma 2.3 and it follows from Theorem 1.1 that there are η i ∈ Λ r−i R r , i ∈ {0, . . ., r}, such that (f • π)ν = r i=0 ϕ η i .We claim that each ϕ η i factors through f r / Ker π.Indeed, since π commutes with dilations, we have for all (θ, ω) This implies that for all i ∈ {0, . . ., r}, ϕ η i (θ + τ, ω + ζ) = ϕ η i (θ, ω) for all (θ, ω) ∈ f r , (τ, ζ) ∈ Ker π, i.e., ϕ η i factors through f r / Ker π, as claimed.Since π is surjective, it follows that for each i ∈ {0, . . ., r} there is we get from Corollary 2.4 that f i ∈ Aff h (g) i (note indeed that the analogue of Corollary 2.4 holds true for Λ n R n -valued functions).Let us now verify that f r = 0. Since ϕ ηr factors through f r / Ker π, we know from Lemma 4.1 that η r ∈ Anh 0 Ker π.
Since g is not isomorphic to f r , we have Ker π = {0} and hence Anh 0 Ker π = {0}.Therefore η r = 0 and hence f r = 0.All together we get that f = r−1 i=0 f i ∈ r−1 i=0 Aff h (g) i and this concludes the proof of Theorem 1.2.
We now prove Theorem 1.3 Proof of Theorem 1.3.Let g be a step-2 rank-r Carnot algegra, n ≥ r, and π : Since Ker π is a graded ideal of f n , we know from Lemma 4.1 that ϕ η factors through f n / Ker π and since π is surjective we get the existence of a unique function f : Corollary 2.4 and it follows from Theorem 1.1 (ii) that there is a unique η ∈ Λ n−i R n such that (f • π)ν = ϕ η .This equality shows in turn that ϕ η factors through f n / Ker π and hence η ∈ Anh n−i Ker π by Lemma 4.1, which concludes the proof Theorem 1.3 (ii).By linearity of the map η → ϕ η , we get that the bijective map η ∈ Anh n−i Ker π → f ∈ Aff h (g) i where f is given by Theorem 1.3 (i) is linear and therefore is an isomorphism of vector spaces, which concludes the proof of Theorem 1.3 (iii).By Theorem 1.1 (i) and Theorem 1.2, it follows that Aff h (g) and n i=0 Anh n−i Ker π are isomorphic as vector spaces.Finally, since Ker π is a graded ideal of f n , we get from Corollary 6.9 that Anh Ker π = n i=0 Anh n−i Ker π.Therefore Aff h (g) and Anh Ker π are isomorphic as vector spaces, which concludes the proof of Theorem 1.3 (iv).Remark 4.2.If g is a step-2 rank-r Carnot algebra that is not isomorphic to f r then dim Aff h (g) ≤ 2 r − r + 1. Indeed consider a surjective Carnot morphism π : f r → g.Then Ker π is a non trivial graded ideal of f r that is contained in Λ 2 R r .Therefore Anh r Ker π = Λ r R r by (6.6), Anh r−1 Ker π = Anh r−1 {0} = Λ r−1 R r where the first equality follows from (6.7), and Anh r−i Ker π Λ r−i R r for i ∈ {2, . . ., r − 1}.This latter claim indeed follows from the inclusion Ker π ⊂ Λ 2 R r together with the fact that Anh 2 Λ r−i R r = {0} for i ∈ {2, . . ., r − 1}, see Lemma 6.4.By Theorem 1.3 (iii) we get that Aff h (g) i and Λ r−i R r are isomorphic for i ∈ {0, 1} and dim Aff h (g Remark 4.3.It follows from Theorems 1.1, 1.2, 1.3 (iii), and Lemma 6.11 that if g is a step-2 Carnot algebra then Aff h (g) i = {0} for some non negative integer i if and only if j≥i Aff h (g) j = {0}.Remark 4.4.Note that it follows from Theorems 1.1 and 1.3 (iii) that if n > r ≥ 2 and π : f n → f r is a surjective Carnot morphism then Anh n−i Ker π = {0} for i ∈ {r + 1, . . ., n}.Similarly, it follows from Theorems 1.2 and 1.3 (iii) that if g is a step-2 rank-r Carnot algebra that is not isomorphic to f r , n ≥ r, and π : f n → g is a surjective Carnot morphism then Anh n−i Ker π = {0} for i ∈ {r, . . ., n}.

5.
Step-2 Carnot algebras where horizontally affine functions are affine 5.1.Characterization.This section is devoted to the proof of Theorem 1.4 that characterizes step-2 Carnot algebras where h-affine functions are affine.We begin with an easy consequence of Theorem 1.3.Lemma 5.1.Let g be a step-2 Carnot algebra.Then 2 i=0 Aff h (g) i ⊂ Aff(g).
Proof.Let f ∈ 2 i=0 Aff h (g) i .Let r := rank g, π : f r → g be a surjective Carnot morphism, and ν ∈ Λ r R r \ {0}.By Theorem 1.3 (ii) there are η Then it clearly follows from the form of ϕ η i , see (1.1), together with the fact that π is a surjective Carnot morphism that f ∈ Aff(g).
We now turn to the proof of Theorem 1.4.
Proof of Theorem 1.4.The equivalence between Theorem 1.4 (i) and (ii) follows from Lemmas 2.5 and 5.1.Next, Theorem 1.4 (ii) clearly implies Theorem 1.4 (iii) since Aff h (g) i are linear subspaces of Aff h (g) that are in direct sum, recalling also that i≥3 Aff h (g Next, assume that g is I-null.Let n ≥ max{3, r} and π : f n → g be a surjective Carnot morphism and let us verify that Anh n−3 Ker π = {0}.Let ν ∈ Λ n R n \ {0} be given.By Theorem 1. it follows that f = 0 and hence η = 0 by Corollary 6.5.Therefore Anh n−3 Ker π = {0}, as wanted.Recall that this is in turn equivalent to n i=3 Anh n−i Ker π = {0} by Lemma 6.11.To conclude the proof of Theorem 1.4, assume that there are n ≥ max{3, r} and a surjective Carnot morphism π : f n → g such that n i=3 Anh n−i Ker π = {0}.By Theorem 1.3 (iii) we get that n i=3 Aff h (g) i = {0} and Theorems 1.1 (i) and 1.2 imply in turn Theorem 1.4 (ii).

Examples.
In this section we deduce from Theorem 1.4 sufficient conditions implying that h-affine functions are affine and necessary conditions that must be satisfied when this is the case.These conditions may be easier to verify on concrete examples than those given in the characterization obtained in Theorem 1.4.We however illustrate with explicit examples to what extent some of these easier conditions cannot be turned into characterizations of step-2 Carnot algebras where h-affine functions are affine.We shall also see from some of these examples that, unlike affine functions, a h-affine function defined on a Lie subalgebra of a step-2 Carnot algebra may not admit a h-affine extension to the whole algebra.
Note that it may happen that Aff(g) Aff h (g) while Aff h (g ′ ) = Aff(g ′ ) for every proper quotient g ′ of g, i.e., for every quotient of g that is not isomorphic to g.A simple example is given by the free step-2 rank-3 Carnot algebra f 3 .Indeed, we know from Theorem 1.1 that Aff(f 3 ) Aff h (f 3 ), whereas every proper quotient g ′ of f 3 is either isomorphic to f 2 or has rank 3 and is not isomorphic to f 3 , therefore Aff h (g ′ ) = Aff(g ′ ) by Theorems 3.2, 1.2, and 1.4 (i)-(ii).See also Example 5.6 for another example that is not isomorphic to f 3 .
Note also that since Aff(f 3 ) Aff h (f 3 ), Proposition 5.4 has the following immediate corollary.
Corollary 5.5.Let g be a step-2 Carnot algebra that has f 3 as one of its quotients.Then Aff(g) Aff h (g).
It may happen that Aff(g) Aff h (g) while g does not have f 3 as one of its quotients, as shows Example 5.6 where g is a step-2 rank-5 Carnot algebra such that Aff(g) Aff h (g) and Aff h (g ′ ) = Aff(g ′ ) for every proper quotient g ′ of g.
Example 5.6.Let i be the graded ideal of f 5 given by i := Anh 2 {ζ} where ζ := e 12 + e 45 and let g := f 5 /i so that g is in particular a step-2 rank-5 Carnot algebra and therefore is not isomorphic to f 3 .We have ζ ∈ Anh 2 i and hence Aff(g) Aff h (g) by Theorem 1.4 (i)-(v).We now claim that Aff h (g ′ ) = Aff(g ′ ) for every proper quotient g ′ of g.Indeed, let g ′ be a proper quotient of g and let π : g → g ′ be a surjective Carnot morphism.Let π : f 5 → g denote the quotient map so that π • π : f 5 → g ′ is a surjective Carnot morphism and let us verify that Anh We recall that the direct product g × R d of a step-2 Carnot algebra with an abelian Lie algebra and the direct product g × g ′ of step-2 Carnot algebras inherit naturally of a structure of step-2 Carnot algebra from those of g and g ′ .Proposition 5.7.Let g, g ′ be a step-2 Carnot algebras and d ≥ 1 be an integer.Then the following holds true: Proof.By [11,Lemma 2.3] any finite direct product of I-null Lie algebras is I-null.Therefore it follows from Theorem 1.4 (i)-(iv) that Aff h (g × g ′ ) = Aff(g × g ′ ) whenever Aff h (g) = Aff(g) and Aff h (g ′ ) = Aff(g ′ ).Similarly, since abelian Lie algebras are I-null (see Definition 2.6), we have Aff h (g × R d ) = Aff(g × R d ) whenever Aff h (g) = Aff(g).The converse implications in (i) and (ii) follow from Proposition 5.4 noting that the projection maps from g × g ′ onto either g or g ′ and from g × R d onto g are surjective Carnot morphisms.
The next proposition is another simple consequence of Theorem 1.4 that gives a sufficient condition ensuring that h-affine maps are affine.Proposition 5.8.Let g be a step-2 Carnot algebra such that Aff(g) Aff h (g).Then there is a Lie subalgebra of g isomorphic to f 3 .
Proof.By Theorem 1.4 (i)-(iv) we know that g is not I-null.Then let b : g 1 × g 2 → R be a non zero bilinear form such that b(x, [x, x ′ ]) = 0 for all x, x ′ ∈ g 1 .Since b = 0, there are x ∈ g 1 , z ∈ g 2 such that b(x, z) = 0.By bilinearity together with the fact that [g 1 , g 1 ] = g 2 , it follows that there are x 3 ] are linearly independent and therefore the Lie subalgebra of g generated by x 1 , x 2 , x 3 is isomorphic to f 3 .Indeed, note that since b(x, [x, x ′ ]) = 0 for all x, x ′ ∈ g 1 , the trilinear form (x, where k < l and {k, l} = {1, 2, 3} \ {i}.Since b(x i , [x k , x l ]) = 0 for such indices i, k, l, it follows that s 1 = s 2 = s 3 = 0, which concludes the proof of the lemma.
We stress that I-null step-2 Carnot algebras may have Lie subalgebras isomorphic to f 3 , as shown in the following two examples.
Example 5.9.[The quaternionic Heisenberg algebra.]Let i, j, k denote the quaternion units satisfying i 2 = j 2 = k 2 = ijk = −1 and denote by H := {q 1 + iq 2 + jq 3 + kq 4 : q i ∈ R} the set of quaternions.Given q = q 1 + iq 2 + jq 3 + kq 4 ∈ H, denote by Im q := iq 2 + jq 3 + kq 4 its imaginary part and q := q 1 − iq 2 − jq 3 − kq 4 its conjugate.Equip H ⊕ Im H with the Lie bracket for which the only non trivial relations are given by [q, q ′ ] := Im(q q ′ ) for q, q ′ ∈ H which makes H ⊕ Im H a step-2 Carnot algebra that is well known to be of Heisenberg type, and therefore of Métivier's type (see for instance [9]).Therefore we have Aff h (H ⊕ Im H) = Aff(H ⊕ Im H) and H ⊕ Im H is I-null by Proposition 5.2.We now claim that the Lie subalgebra of H ⊕ Im H generated by any three linearly independent elements in H is isomorphic to f 3 .Indeed, for q, q ′ ∈ H, we have [q, q ′ ] = 0 if and only if q and q ′ are colinear.This indeed follows from the fact that for q ∈ H \ {0}, the linear map ad q : q ′ ∈ H → [q, q ′ ] ∈ Im H is surjective with q ∈ Ker ad q , together with the fact that dim H = 4 and dim Im H = 3.Then let q 1 , q 2 , q 3 ∈ H be linearly independent and assume by contradiction that dim span{[q i , q j ] : i, j ∈ {1, 2, 3}} ≤ 2. Exchanging the role of q 1 , q 2 , q 3 if necessary, there are s, t ∈ R such that [q 2 , q 3 ] = s[q 1 , q 2 ] + t[q 1 , q 3 ].Then [q 2 −tq 1 , sq 1 +q 3 ] = 0 which implies that q 2 −tq 1 and sq 1 +q 3 are colinear and contradicts the fact that q 1 , q 2 , q 3 are linearly independent.Therefore dim span{[q i , q j ] : i, j ∈ {1, 2, 3}} = 3 and the Lie subalgebra generated by q 1 , q 2 , q 3 is isomorphic to f 3 , as claimed.
Example 5.10.Let g := f 4 /i where i := span{e 12 + e 34 } be the I-null step-2 Carnot algebra given by Example 5.3.We claim that the Lie subalgebra of g generated by any three linearly independent elements in Λ 1 R 4 is isomorphic to f 3 .Indeed let π : f 4 → g denote the quotient map.Let θ 1 , θ 2 , θ 3 ∈ Λ 1 R 4 be linearly independent and let a, b, c ∈ R be such that a π(θ 0 while Ker π = span{e 12 + e 34 } with (e 12 + e 34 ) 2 = 0. the contrary an affine function defined on an affine subspace of a vector space can always be extended to an affine function on the whole space.

Appendix about linear and exterior algebra
We gather in this appendix some basic facts about linear and exterior algebra not pertaining to h-affine functions that have been used in the previous sections.
We start with a characterization of affine maps between real vector spaces whose elementary proof is left to the reader.Proposition 6.1.Let E, F be real vector spaces.A map f : E → F is affine if and only if for every x, y ∈ E, the map t ∈ R → f (x + ty) is affine.
For the sake of completeness, we state below an elementary property of multiaffine functions that has been used in the proof of Proposition 3.4.The proof can easily be done by induction on the dimension and is left to the reader.Proposition 6.2.Let p ≥ 1 be an integer and E be a p-dimensional real vector space.Let f : E → R and assume that there is a basis (e 1 , . . ., e p ) of E such that the map t ∈ R → f (v + te j ) is affine for every v ∈ E and j ∈ {1, . . ., p}.Then f is a linear combination of the u J , where J ranges over the subsets of {1, . . ., p} and u J (v) := j∈J v j for v = p j=1 v j e j with the convention u ∅ (v) := 1.
The rest of this appendix is devoted to (basic) facts about exterior algebra that have been used throughout this paper.Although some of them look quite elementary, we were however unable to find references in the literature and thus provide proofs for the reader's convenience.
Given integers n ≥ 1 and k ≥ 1 we denote by Λ k R n the set of alternating k-multilinear forms over R n .For k = 0 we set Λ 0 R n := R. We denote by Λ * R n := k≥0 Λ k R n the exterior algebra equipped with exterior product ∧.We recall that Λ for all k ≥ 0.
The space of exterior annihilators of an element in Λ i R n of some given order k has been introduced in [7], see also [6,  We also set Λ ≥k R n := i≥k Λ i R n .Lemma 6.4.For n ≥ 1, k ∈ {0, . . ., n}, we have Anh Λ k R n = Λ ≥n−k+1 R n .
Let us now argue by induction on n.First, if n = 1, the conclusion follows from the previous remark.Next, let n ≥ 2. By the previous remark we only need to consider the case where k ∈ {1, . . ., n − 1}.By linearity of η, we only need to prove that there is η ∈ Λ k−1 R n such that η(e j ) = e j ∧ η for j ∈ {1, . . ., n}.Set V j := {x ∈ R n : e j (x) = 0} for j ∈ {1, . . ., n}.
Recall that a graded ideal i of f n can be seen as a linear subspace of Λ * R n of the form i = i 1 ⊕ i 2 where i 1 , i 2 are linear subspaces of respectively Λ 1 R n , Λ 2 R n such that θ ∧ θ ′ ∈ i 2 for all θ ∈ Λ 1 R n , θ ′ ∈ i 1 .The structure of annihilators of such subsets of Λ * R n , and in particular Corollary 6.9 and Lemma 6.10, played a major role in Section 4. Before proving Corollary 6.9 and Lemma 6.10, we first state two elementary lemmas.The easy proof of Lemma 6.7 is left to the reader.Lemma 6.7.Let V, W be linear subspaces of Λ * R n that are in direct sum.Then Anh(V ⊕ W ) = Anh V ∩ Anh W and Anh k (V ⊕ W ) = Anh k V ∩ Anh k W for all k ≥ 0. Lemma 6.8.Let n ≥ 1, j ≥ 0, A ⊂ Λ j R n .Then Anh A = k≥0 Anh k A.

1 )/ 2
I n k and we prove by induction on k that c I ∈ Aff(Λ 1 R n ) for all I ∈ I n k .For k = 0 we have I n 0 = {∅} with c ∅ (θ) = f (θ, 0) and we apply (3.2) with ω = 0 to get that c ∅

(3. 5 )
a I = 0 for all I ∈ I n k \ I n k .For k ∈ {0, 1}, we have I n k = I n k and there is nothing to prove.Let k ∈ {2, . . ., n(n − 1)/2} be given.First, note that I ∈ I n k \I n